package com.dragon.mmochat.model.role;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;

import com.dragon.mmochat.MmochatConstant;
import com.dragon.mmochat.model.attackMode.MmochatAttackModeOfAddBlood;
import com.dragon.mmochat.model.attackMode.MmochatAttackModeOfNormal;
import com.dragon.mmochat.model.attackMode.MmochatAttackModeOfRescueTeamer;
import com.dragon.mmochat.model.attackMode.MmochatAttackModeOfSpecialSkill;
import com.dragon.mmochat.model.battle.MmochatBattle;
import com.dragon.mmochat.model.battle.MmochatBattleOrder;
import com.dragon.mmochat.model.battle.MmochatSme;
import com.dragon.mmochat.model.enumType.MmochatActionType;
import com.dragon.mmochat.model.enumType.MmochatBattleOrderType;
import com.dragon.mmochat.model.enumType.MmochatEquipAttributeType;
import com.dragon.mmochat.model.enumType.MmochatFamilyType;
import com.dragon.mmochat.model.enumType.MmochatMaterialType;
import com.dragon.mmochat.model.enumType.MmochatPetType;
import com.dragon.mmochat.model.enumType.MmochatRoleBmpType;
import com.dragon.mmochat.model.enumType.MmochatRoleType;
import com.dragon.mmochat.model.enumType.MmochatSkillType;
import com.dragon.mmochat.model.enumType.MmochatSmeResult;
import com.dragon.mmochat.model.enumType.MmochatSmeType;
import com.dragon.mmochat.model.skill.MmochatSkill;
import com.dragon.mmochat.util.MmochatUtil;
import com.google.gson.reflect.TypeToken;

//怪物
public class MmochatMonster implements MmochatRole, Serializable {
	private static final long serialVersionUID = 5446583599397014991L;
	protected int level = 0;
	protected MmochatRoleType roleType = MmochatRoleType.食人草;// 怪.宠种类
	protected MmochatPetType petType = MmochatPetType.野生;
	protected boolean canBeCatch = true; // 能否捕捉

	// 成长系统
	protected int blood_protential = 0; // 血量成长
	protected int physicalAttack_protential = 0; // 物攻成长
	protected int magicAttack_protential = 0; // 法攻成长
	protected int speed_protential = 0; // 速度成长
	protected int physicalDefend_protential = 0; // 物防成长
	protected int magicDefend_protential = 0; // 法防成长

	protected MmochatFamilyType family = MmochatFamilyType.人教; // 技能门派
	protected MmochatRoleBmpType bmpType = MmochatRoleBmpType.动物;
	protected int dao = 0; // 道行
	private boolean canRescure = false;
	private String name = null;

	protected int life_turn = 0; // 转生次数

	// 战斗属性
	private int totalBlood = 0; // 血量
	private int speed = 0; // 速度
	private int physicalAttack = 0; // 物伤
	private int spritAttack = 0; // 法伤
	protected int physicalDefend = 0; // 物防
	protected int magicDefend = 0; // 法防
	protected int physicalDeadlyAttack = 0; // 物理暴击
	protected int physicalDeadlyAttackDefend = 0; // 物理暴击抵抗
	protected int magicDeadlyAttack = 0; // 法术暴击
	protected int magicDeadlyAttackDefend = 0; // 法术暴击抵抗
	protected int physicalDoubleAttack = 0; // 物理致命一击
	protected int physicalDoubleAttackDefend = 0; // 物理致命一击抵抗
	protected int magicDoubleAttack = 0; // 法术致命一击
	protected int magicDoubleAttackDefend = 0; // 法术致命一击抵抗
	protected int physicalDefendIgnore = 0;// 物理破防
	protected int magicDefendIgnore = 0;// 法术破防
	protected int physicalAvoid = 1;// 物理闪避
	protected int magicAvoid = 1;// 法术闪避
	protected int antiConfuse = 0;// 抗混
	protected int antiFreeze = 0;// 抗冰
	protected int antiSeal = 0;// 抗封
	protected int ignoreAntiConfuse = 0;// 忽视抗混
	protected int ignoreAntiFreeze = 0;// 忽视抗冰
	protected int ignoreAntiSeal = 0;// 忽视抗封
	protected int strengthenConfuse = 0;// 强力混
	protected int strengthenFreeze = 0;// 强力冰
	protected int strengthenSeal = 0;// 强力封
	protected int physicalDefendPercent = 0; // 物免
	protected int magicDefendPercent = 0; // 法免
	protected int superPhysicalAttack = 0; // 神圣物理伤害
	protected int superSpritAttack = 0; // 神圣法术伤害
	protected int antiGodSkill = 0;// 抗雷
	protected int antiHumanSkill = 0;// 抗水
	protected int antiDevilSkill = 0;// 抗毒
	protected int ignoreAntiGodSkill = 0;// 忽视抗雷
	protected int ignoreAntiHumanSkill = 0;// 忽视抗水
	protected int ignoreAntiDevilSkill = 0;// 忽视抗毒

	protected int bloodExtra = 0;// 血量强化灵气值
	protected int physicalExtra = 0;// 物攻强化灵气值
	protected int magicExtra = 0;// 法攻强化灵气值
	protected int speedExtra = 0;// 速度强化灵气值

	// 可掉落的材料
	private List<MmochatMaterialType> materials = new ArrayList<MmochatMaterialType>();
	// 回合战斗中使用
	protected int battleId = 0; // 0表示没在战斗, >0战场ID
	protected int curPkBlood = 0; // 当前战斗中的血量
	protected int curPkSprit = 0; // 当前战斗中的灵力
	protected boolean useDefendInPk = false; // 本回合中是否使用了防御
	private int killExp = 0; // 杀死本怪奖励的经验值
	private int killSmallMoney = 0; // 杀死本怪奖励的游戏币
	// 动画类别-->保持回合数
	protected Map<MmochatSmeType, MmochatSme> sme = new ConcurrentHashMap<MmochatSmeType, MmochatSme>(); // 障碍动画
	// 战斗指令类型-->战斗指令
	protected Map<MmochatBattleOrderType, MmochatBattleOrder> battleOrders = new ConcurrentHashMap<MmochatBattleOrderType, MmochatBattleOrder>();

	// 技能列表
	protected Map<MmochatSkillType, MmochatSkill> skills = new ConcurrentHashMap<MmochatSkillType, MmochatSkill>();
	private int bossMaxSkillTargetNum = 2; // boss设置里设置的最大攻击目标数

	// AI攻击模式
	MmochatAttackModeOfNormal attackMode_normal = null;
	MmochatAttackModeOfAddBlood attackMode_addBlood = null;
	MmochatAttackModeOfRescueTeamer attackMode_rescueTeamer = null;
	List<MmochatAttackModeOfSpecialSkill> attackModeOfSpecialSkill = new ArrayList<MmochatAttackModeOfSpecialSkill>();
	// 如果此项非null，则战斗方式直接按此项执行，不再考虑AI模式，执行后重设为null
	MmochatActionType fixedActionType = null;

	private MmochatRoleBmpType curRoleBmpType = MmochatRoleBmpType.官;// 战斗中使用，不用存数据库

	public MmochatMonster() {
		attackMode_normal = new MmochatAttackModeOfNormal();
		attackMode_normal.setPhysicalAttackOpportunity(50);
		attackMode_normal.setMagicAttackOppotunity(50);
		attackMode_normal.setLimitOppotunity(0);
		setRandFamily();
	}

	// 生成野外怪物
	public MmochatMonster(int level) {
		this.level = level;
		attackMode_normal = new MmochatAttackModeOfNormal();
		if ((level & 1) == 0) {
			// 偶数
			attackMode_normal.setPhysicalAttackOpportunity(20);
			attackMode_normal.setMagicAttackOppotunity(80);
			attackMode_normal.setLimitOppotunity(0);
		} else {
			attackMode_normal.setPhysicalAttackOpportunity(100);
			attackMode_normal.setMagicAttackOppotunity(0);
			attackMode_normal.setLimitOppotunity(0);
		}
		setRandFamily();
	}

	public MmochatMonster getClone() {
		return (MmochatMonster) MmochatUtil.deepClone(this);
	}

	public void leaveBattle() {
		battleId = 0;
		sme.clear();
	}

	public long getSmeValue() {
		long value = 0;
		for (MmochatSmeType type : sme.keySet()) {
			value += type.getValue();
		}
		return value;
	}

	public void addSme(MmochatSme newSme) {
		if (newSme != null && newSme.getKeepRound() > 0) {
			sme.put(newSme.getType(), newSme);
		}
	}

	// 每回合过后动画效果保持回合数减1
	public MmochatSmeResult decreaseSme() {
		boolean hasReset = false;
		boolean hasChange = false;
		Map<MmochatSmeType, MmochatSme> newSme = new ConcurrentHashMap<MmochatSmeType, MmochatSme>(
				sme);
		sme.clear();
		sme = newSme;
		for (MmochatSme s : sme.values()) {
			s.decreaseKeepRound();
			if (s.getKeepRound() <= 0) {
				sme.remove(s.getType());
				switch (s.getType()) {
				case 三魂丹:
				case 七魄丹: {
					hasReset = true;
					break;
				}
				default:
					hasChange = true;
					break;
				}
			}
		}
		if (hasReset && hasChange) {
			return MmochatSmeResult.重设角色及变更状态;
		}
		if (hasReset) {
			return MmochatSmeResult.重设角色;
		}
		if (hasChange) {
			return MmochatSmeResult.变更状态;
		}
		return MmochatSmeResult.无变更;
	}

	public void delSme(MmochatSmeType type) {
		sme.remove(type);
	}

	public void delCurPkBlood(int delBlood) {
		curPkBlood -= delBlood;
		curPkBlood = Math.max(0, curPkBlood);
		curPkBlood = Math.min(getTotalBlood(), curPkBlood);
	}

	public void delCurPkSprit(int delSprit) {
		curPkSprit -= delSprit;
		curPkSprit = Math.max(0, curPkSprit);
		curPkSprit = Math.min(getTotalSprit(), curPkSprit);
	}

	public void setAntiAll(int antiValue) {
		antiConfuse = antiValue;
		antiFreeze = antiValue;
		antiSeal = antiValue;
	}

	public void addAntiConfuse(int add) {
		antiConfuse += add;
		antiConfuse = Math.min(antiConfuse, MmochatConstant.maxPetAntiLimit);
	}

	public void addAntiFreeze(int add) {
		antiFreeze += add;
		antiFreeze = Math.min(antiFreeze, MmochatConstant.maxPetAntiLimit);
	}

	public void addAntiSeal(int add) {
		antiSeal += add;
		antiSeal = Math.min(antiSeal, MmochatConstant.maxPetAntiLimit);
	}

	@Override
	public void initPkState(int battleId, boolean initBlood) {
		setCurPkBlood(getTotalBlood());
		setCurPkSprit(getTotalSprit());
		setBattleId(battleId);
		getSme().clear();
		battleOrders.clear();
		resetCurRoleBmpType();
	}

	public void delSpeed_protential(int del) {
		speed_protential -= del;
		speed_protential = Math.max(0, speed_protential);
	}

	public boolean hasSme(MmochatSmeType type) {
		if (sme == null || sme.size() == 0) {
			return false;
		}
		MmochatSme s = sme.get(type);
		if (s != null && s.getKeepRound() > 0) {
			return true;
		}
		return false;
	}

	public void addMaterial(MmochatMaterialType material) {
		if (material != null) {
			materials.add(material);
		}
	}

	public String getName() {
		if (name == null) {
			return roleType.toString();
		}
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setRandFamily() {
		int index = MmochatUtil
				.getRandomValue(MmochatFamilyType.values().length);
		this.family = MmochatFamilyType.getByIndex(index);
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public int getTrueLevel() {
		return level + life_turn * 10;
	}

	public MmochatRoleType getRoleType() {
		return roleType;
	}

	public void setRoleType(MmochatRoleType roleType) {
		this.roleType = roleType;
	}

	public int getBlood_protential() {
		return blood_protential;
	}

	public void setBlood_protential(int bloodProtential) {
		blood_protential = bloodProtential;
	}

	public int getPhysicalAttack_protential() {
		return physicalAttack_protential;
	}

	public void setPhysicalAttack_protential(int physicalAttackProtential) {
		physicalAttack_protential = physicalAttackProtential;
	}

	public int getMagicAttack_protential() {
		return magicAttack_protential;
	}

	public void setMagicAttack_protential(int magicAttackProtential) {
		magicAttack_protential = magicAttackProtential;
	}

	public int getSpeed_protential() {
		return speed_protential;
	}

	public void setSpeed_protential(int speedProtential) {
		speed_protential = speedProtential;
	}

	public int getPhysicalDefend_protential() {
		return physicalDefend_protential;
	}

	public void setPhysicalDefend_protential(int physicalDefendProtential) {
		physicalDefend_protential = physicalDefendProtential;
	}

	public int getMagicDefend_protential() {
		return magicDefend_protential;
	}

	public void setMagicDefend_protential(int magicDefendProtential) {
		magicDefend_protential = magicDefendProtential;
	}

	public MmochatFamilyType getFamily() {
		return family;
	}

	public void setFamily(MmochatFamilyType family) {
		this.family = family;
	}

	public MmochatRoleBmpType getBmpType() {
		return bmpType;
	}

	public void setBmpType(MmochatRoleBmpType bmpType) {
		this.bmpType = bmpType;
	}

	public int getDao() {
		return dao;
	}

	public void setDao(int dao) {
		this.dao = dao;
	}

	public boolean isCanRescure() {
		return canRescure;
	}

	public void setCanRescure(boolean canRescure) {
		this.canRescure = canRescure;
	}

	public List<MmochatMaterialType> getMaterials() {
		return materials;
	}

	public void setMaterials(List<MmochatMaterialType> materials) {
		this.materials = materials;
	}

	public boolean hasTheMaterial(MmochatMaterialType type) {
		return materials.contains(type);
	}

	public int getBattleId() {
		return battleId;
	}

	public void setBattleId(int battleId) {
		this.battleId = battleId;
	}

	public int getCurPkBlood() {
		return curPkBlood;
	}

	public void setCurPkBlood(int curPkBlood) {
		this.curPkBlood = curPkBlood;
	}

	public int getCurPkSprit() {
		return curPkSprit;
	}

	public void setCurPkSprit(int curPkSprit) {
		this.curPkSprit = curPkSprit;
	}

	public boolean isUseDefendInPk() {
		return useDefendInPk;
	}

	public void setUseDefendInPk(boolean useDefendInPk) {
		this.useDefendInPk = useDefendInPk;
	}

	public int getKillExp() {
		return killExp;
	}

	public void setKillExp(int killExp) {
		this.killExp = killExp;
	}

	public int getKillSmallMoney() {
		return killSmallMoney;
	}

	public void setKillSmallMoney(int killSmallMoney) {
		this.killSmallMoney = killSmallMoney;
	}

	public Map<MmochatSmeType, MmochatSme> getSme() {
		return sme;
	}

	public void setSme(Map<MmochatSmeType, MmochatSme> sme) {
		this.sme = new ConcurrentHashMap<MmochatSmeType, MmochatSme>(sme);
	}

	public Map<MmochatSkillType, MmochatSkill> getSkills() {
		return skills;
	}

	public void setSkills(Map<MmochatSkillType, MmochatSkill> skills) {
		this.skills = new ConcurrentHashMap<MmochatSkillType, MmochatSkill>(
				skills);
	}

	public void addNewSkill(MmochatSkill skill) {
		skills.put(skill.getType(), skill);
	}

	public int getBossMaxSkillTargetNum() {
		return bossMaxSkillTargetNum;
	}

	public void setBossMaxSkillTargetNum(int bossMaxSkillTargetNum) {
		this.bossMaxSkillTargetNum = bossMaxSkillTargetNum;
	}

	public MmochatAttackModeOfNormal getAttackMode_normal() {
		return attackMode_normal;
	}

	public void setAttackMode_normal(MmochatAttackModeOfNormal attackModeNormal) {
		attackMode_normal = attackModeNormal;
	}

	public MmochatAttackModeOfAddBlood getAttackMode_addBlood() {
		return attackMode_addBlood;
	}

	public void setAttackMode_addBlood(
			MmochatAttackModeOfAddBlood attackModeAddBlood) {
		attackMode_addBlood = attackModeAddBlood;
	}

	public MmochatAttackModeOfRescueTeamer getAttackMode_rescueTeamer() {
		return attackMode_rescueTeamer;
	}

	public void setAttackMode_rescueTeamer(
			MmochatAttackModeOfRescueTeamer attackModeRescueTeamer) {
		attackMode_rescueTeamer = attackModeRescueTeamer;
	}

	@Override
	public int getId() {
		return 0;
	}

	// TODO:以下是战斗属性

	public int getTotalBlood() {
		return totalBlood;
	}

	public void setTotalBlood(int totalBlood) {
		this.totalBlood = totalBlood;
	}

	// 怪是没有蓝的
	public int getTotalSprit() {
		return 0;
	}

	public int getSpeed() {
		// 辅助技能效果
		double addPercent = 0;
		MmochatSme speedSme = sme.get(MmochatSmeType.加速辅助);
		if (speedSme != null && speedSme.getKeepRound() > 0) {
			addPercent += speedSme.getValue();
		}
		double trueSpeed = speed * (100 + addPercent) / 100;

		return (int) trueSpeed;
	}

	public void setSpeed(int speed) {
		this.speed = speed;
	}

	public int getPhysicalAttack() {
		// 辅助技能效果
		double addPercent = 0;
		MmochatSme attackSme = sme.get(MmochatSmeType.加攻辅助);
		if (attackSme != null && attackSme.getKeepRound() > 0) {
			addPercent += attackSme.getValue();
		}
		double trueAttack = physicalAttack * (100 + addPercent) / 100;

		return (int) trueAttack;
	}

	public void setPhysicalAttack(int physicalAttack) {
		this.physicalAttack = physicalAttack;
	}

	public int getSpritAttack() {
		// 辅助技能效果
		double addPercent = 0;
		MmochatSme attackSme = sme.get(MmochatSmeType.加攻辅助);
		if (attackSme != null && attackSme.getKeepRound() > 0) {
			addPercent += attackSme.getValue();
		}
		double trueAttack = spritAttack * (100 + addPercent) / 100;

		return (int) trueAttack;
	}

	public void setSpritAttack(int spritAttack) {
		this.spritAttack = spritAttack;
	}

	public int getPhysicalDefend() {
		return physicalDefend;
	}

	public void setPhysicalDefend(int physicalDefend) {
		this.physicalDefend = physicalDefend;
	}

	public int getMagicDefend() {
		return magicDefend;
	}

	public void setMagicDefend(int magicDefend) {
		this.magicDefend = magicDefend;
	}

	public int getPhysicalDeadlyAttack() {
		return physicalDeadlyAttack;
	}

	public void setPhysicalDeadlyAttack(int physicalDeadlyAttack) {
		this.physicalDeadlyAttack = physicalDeadlyAttack;
	}

	public int getPhysicalDeadlyAttackDefend() {
		return physicalDeadlyAttackDefend;
	}

	public void setPhysicalDeadlyAttackDefend(int physicalDeadlyAttackDefend) {
		this.physicalDeadlyAttackDefend = physicalDeadlyAttackDefend;
	}

	public int getMagicDeadlyAttack() {
		return magicDeadlyAttack;
	}

	public void setMagicDeadlyAttack(int magicDeadlyAttack) {
		this.magicDeadlyAttack = magicDeadlyAttack;
	}

	public int getMagicDeadlyAttackDefend() {
		return magicDeadlyAttackDefend;
	}

	public void setMagicDeadlyAttackDefend(int magicDeadlyAttackDefend) {
		this.magicDeadlyAttackDefend = magicDeadlyAttackDefend;
	}

	public int getPhysicalDoubleAttack() {
		return physicalDoubleAttack;
	}

	public void setPhysicalDoubleAttack(int physicalDoubleAttack) {
		this.physicalDoubleAttack = physicalDoubleAttack;
	}

	public int getPhysicalDoubleAttackDefend() {
		return physicalDoubleAttackDefend;
	}

	public void setPhysicalDoubleAttackDefend(int physicalDoubleAttackDefend) {
		this.physicalDoubleAttackDefend = physicalDoubleAttackDefend;
	}

	public int getMagicDoubleAttack() {
		return magicDoubleAttack;
	}

	public void setMagicDoubleAttack(int magicDoubleAttack) {
		this.magicDoubleAttack = magicDoubleAttack;
	}

	public int getMagicDoubleAttackDefend() {
		return magicDoubleAttackDefend;
	}

	public void setMagicDoubleAttackDefend(int magicDoubleAttackDefend) {
		this.magicDoubleAttackDefend = magicDoubleAttackDefend;
	}

	public int getPhysicalDefendIgnore() {
		return physicalDefendIgnore;
	}

	public void setPhysicalDefendIgnore(int physicalDefendIgnore) {
		this.physicalDefendIgnore = physicalDefendIgnore;
	}

	public int getMagicDefendIgnore() {
		return magicDefendIgnore;
	}

	public void setMagicDefendIgnore(int magicDefendIgnore) {
		this.magicDefendIgnore = magicDefendIgnore;
	}

	public int getPhysicalAvoid() {
		return physicalAvoid;
	}

	public void setPhysicalAvoid(int physicalAvoid) {
		this.physicalAvoid = physicalAvoid;
	}

	public int getMagicAvoid() {
		return magicAvoid;
	}

	public void setMagicAvoid(int magicAvoid) {
		this.magicAvoid = magicAvoid;
	}

	public int getAntiConfuse() {
		return antiConfuse;
	}

	public void setAntiConfuse(int antiConfuse) {
		this.antiConfuse = antiConfuse;
	}

	public int getAntiFreeze() {
		return antiFreeze;
	}

	public void setAntiFreeze(int antiFreeze) {
		this.antiFreeze = antiFreeze;
	}

	public int getAntiSeal() {
		return antiSeal;
	}

	public void setAntiSeal(int antiSeal) {
		this.antiSeal = antiSeal;
	}

	public int getIgnoreAntiConfuse() {
		return ignoreAntiConfuse;
	}

	public void setIgnoreAntiConfuse(int ignoreAntiConfuse) {
		this.ignoreAntiConfuse = ignoreAntiConfuse;
	}

	public int getIgnoreAntiFreeze() {
		return ignoreAntiFreeze;
	}

	public void setIgnoreAntiFreeze(int ignoreAntiFreeze) {
		this.ignoreAntiFreeze = ignoreAntiFreeze;
	}

	public int getIgnoreAntiSeal() {
		return ignoreAntiSeal;
	}

	public void setIgnoreAntiSeal(int ignoreAntiSeal) {
		this.ignoreAntiSeal = ignoreAntiSeal;
	}

	public int getStrengthenConfuse() {
		return strengthenConfuse;
	}

	public void setStrengthenConfuse(int strengthenConfuse) {
		this.strengthenConfuse = strengthenConfuse;
	}

	public int getStrengthenFreeze() {
		return strengthenFreeze;
	}

	public void setStrengthenFreeze(int strengthenFreeze) {
		this.strengthenFreeze = strengthenFreeze;
	}

	public int getStrengthenSeal() {
		return strengthenSeal;
	}

	public void setStrengthenSeal(int strengthenSeal) {
		this.strengthenSeal = strengthenSeal;
	}

	public int getPhysicalDefendPercent() {
		// 辅助技能效果
		double addPercent = 0;
		MmochatSme attackSme = sme.get(MmochatSmeType.加防辅助);
		if (attackSme != null && attackSme.getKeepRound() > 0) {
			addPercent += attackSme.getValue();
		}

		return (int) (physicalDefendPercent + addPercent / 2);
	}

	public void setPhysicalDefendPercent(int physicalDefendPercent) {
		this.physicalDefendPercent = physicalDefendPercent;
	}

	public int getMagicDefendPercent() {
		// 辅助技能效果
		double addPercent = 0;
		MmochatSme attackSme = sme.get(MmochatSmeType.加防辅助);
		if (attackSme != null && attackSme.getKeepRound() > 0) {
			addPercent += attackSme.getValue();
		}
		// 怪物没有防，所以用法免代替
		return (int) (magicDefendPercent + addPercent / 2);
	}

	public void setMagicDefendPercent(int magicDefendPercent) {
		this.magicDefendPercent = magicDefendPercent;
	}

	public int getAntiGodSkill() {
		return antiGodSkill;
	}

	public void setAntiGodSkill(int antiGodSkill) {
		this.antiGodSkill = antiGodSkill;
	}

	public int getAntiHumanSkill() {
		return antiHumanSkill;
	}

	public void setAntiHumanSkill(int antiHumanSkill) {
		this.antiHumanSkill = antiHumanSkill;
	}

	public int getAntiDevilSkill() {
		return antiDevilSkill;
	}

	public void setAntiDevilSkill(int antiDevilSkill) {
		this.antiDevilSkill = antiDevilSkill;
	}

	public int getIgnoreAntiGodSkill() {
		return ignoreAntiGodSkill;
	}

	public void setIgnoreAntiGodSkill(int ignoreAntiGodSkill) {
		this.ignoreAntiGodSkill = ignoreAntiGodSkill;
	}

	public int getIgnoreAntiHumanSkill() {
		return ignoreAntiHumanSkill;
	}

	public void setIgnoreAntiHumanSkill(int ignoreAntiHumanSkill) {
		this.ignoreAntiHumanSkill = ignoreAntiHumanSkill;
	}

	public int getIgnoreAntiDevilSkill() {
		return ignoreAntiDevilSkill;
	}

	public void setIgnoreAntiDevilSkill(int ignoreAntiDevilSkill) {
		this.ignoreAntiDevilSkill = ignoreAntiDevilSkill;
	}

	public int getSuperPhysicalAttack() {
		return superPhysicalAttack;
	}

	public void setSuperPhysicalAttack(int superPhysicalAttack) {
		this.superPhysicalAttack = superPhysicalAttack;
	}

	public int getSuperSpritAttack() {
		return superSpritAttack;
	}

	public void setSuperSpritAttack(int superSpritAttack) {
		this.superSpritAttack = superSpritAttack;
	}

	@Override
	public boolean isDisappearWhenDie() {
		return false;
	}

	public MmochatPetType getPetType() {
		return petType;
	}

	public void setPetType(MmochatPetType petType) {
		this.petType = petType;
	}

	public boolean isCanBeCatch() {
		return canBeCatch;
	}

	public void setCanBeCatch(boolean canBeCatch) {
		this.canBeCatch = canBeCatch;
	}

	@Override
	public int getLife_turn() {
		return life_turn;
	}

	public void setLife_turn(int lifeTurn) {
		life_turn = lifeTurn;
	}

	public Map<MmochatBattleOrderType, MmochatBattleOrder> getBattleOrders() {
		return battleOrders;
	}

	public void setBattleOrders(
			Map<MmochatBattleOrderType, MmochatBattleOrder> battleOrders) {
		this.battleOrders = new ConcurrentHashMap<MmochatBattleOrderType, MmochatBattleOrder>(
				battleOrders);
	}

	public void addBattleOrder(MmochatBattleOrderType orderType) {
		MmochatBattleOrder newOrder = new MmochatBattleOrder(orderType);
		battleOrders.put(orderType, newOrder);
	}

	public boolean hasBattleOrder(MmochatBattleOrderType type) {
		if (battleOrders == null || battleOrders.size() == 0) {
			return false;
		}
		MmochatBattleOrder s = battleOrders.get(type);
		if (s != null && s.getKeepRound() > 0) {
			return true;
		}
		return false;
	}

	// 每回合过后指令保持回合数减1
	public boolean decreaseBattleOrder() {
		boolean hasRemoved = false;
		for (MmochatBattleOrder s : battleOrders.values()) {
			s.decreaseKeepRound();
			if (s.getKeepRound() <= 0) {
				battleOrders.remove(s.getType());
				hasRemoved = true;
			}
		}
		return hasRemoved;
	}

	public MmochatActionType getFixedActionType() {
		return fixedActionType;
	}

	public void setFixedActionType(MmochatActionType fixedActionType) {
		this.fixedActionType = fixedActionType;
	}

	public void reSetFixedActionType() {
		this.fixedActionType = null;
	}

	public List<MmochatAttackModeOfSpecialSkill> getAttackModeOfSpecialSkill() {
		return attackModeOfSpecialSkill;
	}

	public void setAttackModeOfSpecialSkill(
			List<MmochatAttackModeOfSpecialSkill> attackModeOfSpecialSkill) {
		this.attackModeOfSpecialSkill = attackModeOfSpecialSkill;
	}

	public int getBloodExtra() {
		return bloodExtra;
	}

	public void setBloodExtra(int bloodExtra) {
		this.bloodExtra = bloodExtra;
	}

	public void addBloodExtra(int add) {
		bloodExtra += add;
		bloodExtra = Math.max(0, bloodExtra);
		bloodExtra = Math.min(MmochatConstant.maxPetExtraValue, bloodExtra);
	}

	// 血量提升百分比,(1+getBloodExtraPercent())*基础值
	public double getBloodExtraPercent() {
		return 1.0 * bloodExtra / MmochatConstant.petExtraValuePerEffect
				/ 100.0;
	}

	public int getPhysicalExtra() {
		return physicalExtra;
	}

	public void setPhysicalExtra(int physicalExtra) {
		this.physicalExtra = physicalExtra;
	}

	public void addPhysicalExtra(int add) {
		physicalExtra += add;
		physicalExtra = Math.max(0, physicalExtra);
		physicalExtra = Math.min(MmochatConstant.maxPetExtraValue,
				physicalExtra);
	}

	// 物攻提升百分比,(1+getPhysicalExtraPercent())*基础值
	public double getPhysicalExtraPercent() {
		return 1.0 * physicalExtra / MmochatConstant.petExtraValuePerEffect
				/ 100.0;
	}

	public int getSpeedExtra() {
		return speedExtra;
	}

	public void setSpeedExtra(int speedExtra) {
		this.speedExtra = speedExtra;
	}

	public void addSpeedExtra(int add) {
		speedExtra += add;
		speedExtra = Math.max(0, speedExtra);
		speedExtra = Math
				.min(MmochatConstant.maxPetSpeedExtraValue, speedExtra);
	}

	// 速度提升百分比,(1+getSpeedExtraPercent())*基础值
	public double getSpeedExtraPercent() {
		return 1.0 * speedExtra / MmochatConstant.petExtraValuePerEffect
				/ 100.0;
	}

	public int getMagicExtra() {
		return magicExtra;
	}

	public void setMagicExtra(int magicExtra) {
		this.magicExtra = magicExtra;
	}

	public void addMagicExtra(int add) {
		magicExtra += add;
		magicExtra = Math.max(0, magicExtra);
		magicExtra = Math.min(MmochatConstant.maxPetExtraValue, magicExtra);
	}

	// 法攻提升百分比,(1+getMagicExtraPercent())*基础值
	public double getMagicExtraPercent() {
		return 1.0 * magicExtra / MmochatConstant.petExtraValuePerEffect
				/ 100.0;
	}

	public MmochatRoleBmpType getCurRoleBmpType() {
		return curRoleBmpType;
	}

	public void setCurRoleBmpType(MmochatRoleBmpType curRoleBmpType) {
		this.curRoleBmpType = curRoleBmpType;
	}

	public void resetCurRoleBmpType() {
		curRoleBmpType = getBmpType();
	}

	@Override
	public int getCommonEquipAttributeValue(MmochatEquipAttributeType type) {
		return 0;
	}
}
